<?php
include_once("../DAO/DanhMucDAO.php");
include_once("../BUS/DanhMucBUS.php");
include_once("../DAO/DanhMucDTO.php");
include_once("../DAO/DataHelper.php");
 
 	$TenDanhMuc = $_GET['TenDanhMuc'];
	$KiemTra = DanhMucBUS::LayMaDanhMuc($TenDanhMuc);
	$temp = DanhMucDAO::KiemTraXoaDanhMuc($KiemTra);
	//$temp = count($KQ);
	//echo $temp;
	if($temp != true)
	{
		$Xoa = DanhMucDao::XoaDanhMuc($TenDanhMuc);		
	}
	$KQ = DanhMucDAO::DanhMucSanPham();
	echo "<option value ='MucCha'>Chon Danh Muc</option>";
	for($i = 0 ; $i < count($KQ) ; $i++)
	{
		$danhmuc = $KQ[$i];
		echo "<option value = $danhmuc->dm_ma>$danhmuc->dm_ten</option>";
	}
	
 	
?>